#!/usr/bin/python
#coding:utf-8

from __future__ import unicode_literals

from django.db import models

# Create your models here.

class travel(models.Model):
    add_time = models.DateTimeField('添加时间', auto_now_add=True)
    order_no = models.CharField("订单号", max_length=20)
    item_index = models.IntegerField("行程排序")
    day_id = models.IntegerField("所属天")
    type = models.IntegerField("类型")
    location = models.CharField("位置信息", max_length=20)
    start_time = models.IntegerField('开始时间')
    end_time = models.IntegerField('结束时间')
    probably_duration = models.IntegerField("持续时间")
    remark = models.CharField("备注", max_length=20)
    price = models.CharField("花费", max_length=20)
    buy_url = models.CharField("购买链接", max_length=20)
    buy_status = models.CharField("购买状态", max_length=20)
    restaurant = models.CharField("吃", max_length=20)
    stay = models.CharField("住", max_length=20)
    traffic = models.CharField("行", max_length=20)
    scenic = models.CharField("游", max_length=20)
    buy = models.CharField("购", max_length=20)
    things = models.CharField("娱", max_length=20)

    class Meta:
        verbose_name_plural = '行程管理'
        db_table = 'travel'

    def __unicode__(self):
        return self.order_no

class travel_day(models.Model):
    order_no = models.CharField("订单号", max_length=20)
    day_index = models.IntegerField("排序")
    date = models.CharField("日期", max_length=20)
    add_time = models.DateTimeField('添加时间')

    class Meta:
        verbose_name_plural = '行程天'
        db_table = 'travel_day'

    def __unicode__(self):
        return self.date